package com.teamone.etl.datasource.requset;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Description 数据源添加请求参数封装
 * @Author ZhaoPeiJie
 * @Date 2021/1/6 18:36
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DataSourceAddReq {
    @TableId(value = "id",type = IdType.ASSIGN_UUID)
    private String id;
    @NotBlank(message = "数据源名称不能为空")
    private String datasourceName;
    @NotBlank(message = "连接路径不能为空")
    private String datasourceUrl;
    @NotBlank(message = "端口号不能为空")
    private String datasourcePort;
    @NotBlank(message = "用户名不能为空")
    private String username;
    @NotBlank(message = "密码不能为空")
    private String password;
    @NotBlank(message = "数据库名称不能为空")
    private String dbName;
    @NotNull(message = "状态不能为空")
    private Integer isDisable;
    /**1.MySQL 2.Redis
     *
     */
    @NotNull(message = "类型不能为空")
    private Integer typeId;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    private String remarks;
}
